package com.hospital.rank.module.schedule;

import com.hospital.rank.module.service.TRankService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class HotPostStat {
    @Autowired
    private TRankService rankService;

    /**
     * 每月统计热门贴
     */
    @XxlJob("hotPostStat")
    public void hotPostStat() {
        long startTime = System.currentTimeMillis();
        XxlJobHelper.log("开始执行热门贴统计任务");
        rankService.hotPostStat();
        XxlJobHelper.log("结束执行热门贴统计任务，耗时{}ms", System.currentTimeMillis() - startTime);
    }
}
